import React, {Component} from 'react';

const PageContext = React.createContext("Alice")
class Page extends Component {
    render() {
        return (
            <div>
               <PageContext.Provider value="Tom">
                <UserPage/>
               </PageContext.Provider>
            </div>
        );
    }
}

export default Page;


class UserPage extends Component {
    static contextType = PageContext;
    render() {
        return (
            <div>
                {this.context}
            </div>
        );
    }
}




